﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Geometry {
    public struct RayDifferential : IRayDifferential {
        public bool hasDifferentials;
        public Ray rx, ry;

        public static float RAY_EPSILON = 1e-3f;

        public Point o;
        public Vector d;
        public float mint, maxt;
        public float time;

        public Point O { get { return o; } set { o = value; } }
        public Vector D { get { return d; } set { d = value; } }

        public float Mint { get { return mint; } set { mint = value; } }
        public float Maxt { get { return maxt; ;} set { maxt = value; } }
        public float Time { get { return time; } set { time = value; } }

        public bool HasDifferentials { 
            get { return hasDifferentials; } 
            set { hasDifferentials = value; } }
        public Ray Rx { get { return rx; } set { rx = value; } }
        public Ray Ry { get { return ry; } set { ry = value; } }
        
        public RayDifferential(Point origin, Vector direction) {
            this.o = origin;
            this.d = direction;
            this.mint = RAY_EPSILON;
            this.maxt = float.PositiveInfinity;
            this.time = 0.0f;

            this.hasDifferentials = false;
            this.rx = new Ray();
            this.ry = new Ray();
        }
    }
}
